<template>
  <div class="my-tab">
    <div v-if="isshow">
      <p @click="dick">{{ value }}</p>
    </div>
    <div v-else>
      <input
        ref="inp"
        type="text"
        @blur="isshow = true"
        placeholder="请输入标签"
        :value="value"
        @keydown.enter="sendMsg"
      />
    </div>
  </div>
</template>
<script >
export default {
  data() {
    return {
      isshow: true,
    };
  },
  props: {
    value: String,
  },
  components: {},
  created() {},
  mounted() {},
  methods: {
    dick() {
      this.isshow = false;
      this.$nextTick(() => {
        this.$refs.inp.focus();
      });
    },
    sendMsg(e) {
      this.$emit("input", e.target.value);
      this.isshow=true
    },
  },
};
</script>
<style lang='less' scoped>
</style>